import { request } from './request'
import { commonParams } from './config.js'

const getSingerList = () => {
  const url = '/api/getSingerList'
  const data = Object.assign({}, commonParams, {
    channel: 'singer',
    page: 'list',
    key: 'all_all_all',
    pagesize: 100,
    pagenum: 1,
    hostUin: 0,
    needNewCode: 0,
    platform: 'yqq',
    g_tk: 1928093487
  })
  return request({
    url,
    params: data
  })
}

const getSingerDetail = (singer) => {
  const url = '/api/getSingerDetail'
  const data = Object.assign({}, commonParams, {
    hostUin: 0,
    needNewCode: 0,
    platform: 'yqq',
    singermid: singer.mid,
    order: 'listen',
    begin: 0,
    num: 80,
    songstatus: 1
  })
  return request({
    url,
    params: data
  })
}

export {
  getSingerList,
  getSingerDetail
}
